#!/bin/sh
dirname=`dirname $0`
cd $dirname/..
instpath=`pwd`
instpath=$instpath/dist
mkdir -p .build
cd .build
if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
    echo "********** project build script **********"
    echo "$ maker.sh           # debug build"
    echo "$ maker.sh opt       # opt build"
    echo "$ maker.sh install   # opt bulid & install to $instpath"
    echo ""
    exit 0
elif [ "$1" = opt ]; then
    shift
    cmake -DCMAKE_BUILD_TYPE=Release ..
elif [ "$1" = install ]; then
    cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$instpath ..
else
    cmake -DCMAKE_BUILD_TYPE=Debug ..
fi
make $@

# end of maker.sh
